
import  flyio from 'flyio'
import Base from '../../config/testing.env'


let base =  Base.BASE_API
// export const getIterationStatus=(params)=>{return flyio.get(`${base}/manager/getIterationStatus`)}//迭代状态枚举



export const getProject=()=>{return flyio.post( `${base}/strCompare/getproject`) }
export const saveproject = (params)=> { return  flyio.post( `${base}/strCompare/saveproject`,params)}
export const updateproject = (params)=> { return  flyio.post( `${base}/strCompare/updateproject`,params)}


export const getsqlCompareScript = (params)=> { return  flyio.post( `${base}/strCompare/getsqlCompareScript`,params)}
export const deleteScript = (scrpitno,params)=> { return  flyio.post( `${base}/strCompare/deleteScript/${scrpitno}`,params)}
export const savesqlCompareScript = (params)=> { return  flyio.post( `${base}/strCompare/savesqlCompareScript`,params)}
export const updatesqlCompareScript = (params)=> { return  flyio.post( `${base}/strCompare/updatesqlCompareScript`,params)}
export const uploadsqlCompareScripts = ()=> { return   `${base}/strCompare/uploadsqlCompareScripts`}




export const getdbs = (params)=> { return  flyio.post( `${base}/strCompare/getdbs`,params)}
export const getalldbs = (params)=> { return  flyio.post( `${base}/strCompare/getalldbs`,params)}
export const savedb = (params)=> { return  flyio.post( `${base}/strCompare/savedb`,params)}
export const updatedb = (params)=> { return  flyio.post( `${base}/strCompare/updatedb`,params)}
export const dbverify = (params)=> { return  flyio.post( `${base}/strCompare/dbverify`,params)}
export const getdbByProjectId = (projectId,params)=> { return  flyio.post( `${base}/strCompare/getdbByProjectId/${projectId}`,params)}


export const getAllSqlCompareTasks = (params)=> { return  flyio.post( `${base}/strCompare/getAllSqlCompareTasks`,params)}
export const saveSqlCompareTask = (params)=> { return  flyio.post( `${base}/strCompare/saveSqlCompareTask`,params)}
export const updateSqlCompareTask = (params)=> { return  flyio.post( `${base}/strCompare/updateSqlCompareTask`,params)}
export const deleteTask = (taskno,params)=> { return  flyio.post( `${base}/strCompare/deleteTask/${taskno}`,params)}
export const saveTasks = (taskDtos)=> { return  flyio.post( `${base}/strCompare/saveTasks/`,taskDtos)}

export const executeTask = (taskid,params)=> { return  flyio.post( `${base}/strCompare/executeTask/${taskid}`,params)}
export const executeTasks = (params)=> { return  flyio.post( `${base}/strCompare/executeTasks`,params)}



export const getResultsByTask = (taskid,params)=> { return  flyio.post( `${base}/strCompare/getResultsByTask/${taskid}`,params)}
export const getDetailResult = (resultId,params)=> { return  flyio.post( `${base}/strCompare/getDetailResult/${resultId}`,params)}
export const getAllResults = (params)=> { return  flyio.post( `${base}/strCompare/getAllResults/`,params)}

export const login = (username,password,params)=> { return  flyio.post( `${base}/login/${username}/${password}`,params)}


export const downloadallinfos = (params) => {return  flyio.get( `${base}/strCompare/downloadall`,params ,{responseType:"blob"})}
export const downloadResult = (params) => {return  flyio.post( `${base}/strCompare/downloadResult`,params ,{responseType:"blob"})}
export const uploadScript = (projectid,scriptDtos) => {return  flyio.post( `${base}/strCompare/uploadScript/${projectid}`,scriptDtos)}


